package com.cskaoyan.market.controller.wx;

import com.cskaoyan.market.db.domain.MarketTopic;
import com.cskaoyan.market.service.wx.WxTopicService;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author: YaLiFeng
 * @description: TODO
 * @date: 2024/5/21 11:54
 */
@RestController
@RequestMapping("/wx/topic")
public class WxTopicController {
    @Autowired
    WxTopicService wxTopicService;
    @GetMapping("list")
    public Object list(Integer page,Integer limit){
       List<MarketTopic> marketTopicList= wxTopicService.list(page,limit);
       return ResponseUtil.okList(marketTopicList);

    }
    @GetMapping("detail")
    public Object detail(Integer id){
        Map data=wxTopicService.detail(id);
        return ResponseUtil.ok(data);


    }
    @GetMapping("related")
    public Object related(Integer id,Integer limit,Integer page){
        List<MarketTopic> marketTopicList=wxTopicService.related(id, limit, page);
        return ResponseUtil.okList(marketTopicList);

    }

}
